#猫眼图片下载
import requests as rq
header = {'User-Agent':'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36'}

url = 'https://p0.meituan.net/movie/005955214d5b3e50c910d7a511b0cb571445301.jpg'
#获取网页源代码
pic = rq.get(url,headers = header) 
#将网页获取的代码转化成图片
jpg = '下载的图片' + '.jpg' #空的

fp = open(jpg,'wb+') #先打开创建的空文件
fp.write(pic.content) #将图片内容写进空文件
fp.close()


#酷狗音乐
url_m = 'https://webfs.ali.kugou.com/202110191109/d149c0612fbc6eacbd558621c7e5d1ed/KGTX/CLTX001/b208a50fe3efcd58261724bfbbb71b77.mp3'
url_m1 = 'https://webfs.ali.kugou.com/202110191121/67587586b63ad9df46ca421b3ef6edda/G085/M07/0D/04/lQ0DAFs3OuaAEzP9ADPseVKXVbY222.mp3'
url_m2 = 'https://webfs.ali.kugou.com/202110191857/85a4ff99dcdfd43096a7c3c13a7190b6/part/0/960121/KGTX/CLTX001/7f6feb003aa58acd00917db162b25867.mp3'
#获取网页源代码
mp3 = rq.get(url_m) 
mp3_m1 = rq.get(url_m1) 
mp3_m2 = rq.get(url_m2) 

#将网页获取的代码转化成图片
music1 = '画离弦' + '.mp3' #空的
music2 = 'Welcome To New York' + '.mp3' #空的
music3 = '光的方向' + '.mp3' #空的

fp1 = open(music1,'wb+') #先打开创建的空文件
fp2 = open(music2,'wb+') 
fp3 = open(music3,'wb+') 
fp1.write(mp3.content) #将图片内容写进空文件
fp2.write(mp3_m1.content)
fp3.write(mp3_m2.content) 
fp1.close()
fp2.close()
fp3.close()


#网页视频下载
url_s = 'http://v9-xg-web-s.ixigua.com/051aedaa01f1c9373d939524a31a7c95/616ec21a/video/m/220cfc107920ccb4e5aa984451f97aadd161166abb8a00000264e7667784/?a=1768&br=1501&bt=1501&mime_type=video_mp4'
mp4_s = rq.get(url_s,headers = header)
mp4 = '吃鸡' + '.mp4' 
fp4 = open(mp4,'wb+')
fp4.write(mp4_s.content)
fp4.close()

